package com.atguigu.test;

import com.atguigu.aop.MathCalculator;
import com.atguigu.bean.Person;
import com.atguigu.config.MainConfigOfPropertyValues;
import com.atguigu.config.MainConfigofAOP;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

public class IOCTest_AOP {



    @Test
    public void test01() {

        //1. 创建IOC容器
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigofAOP.class);
        //1. 不要自己创建对象
//        MathCalculator mathCalculator = new MathCalculator();
//        mathCalculator.div(1,1);
        MathCalculator bean = applicationContext.getBean(MathCalculator.class);
        bean.div(1,0);
        applicationContext.close();

    }
}
